﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace GomeeSoft.src.control
{
    public partial class UCFrameList : UserControl
    {
        // Encapsulation ******************************************************************
        #region Encapsulation
        public string FrameTitle
        {
            get { return ucFramePanel1.Text; }
            set { ucFramePanel1.Text = value; }
        }
        public bool Selectable
        {
            get { return ucDataGrid1.Selectable; }
            set { ucDataGrid1.Selectable = value; }
        }
        public DataTable DataSource
        {
            get { return ucDataGrid1.DataSource; }
            set { ucDataGrid1.DataSource = value; ucDataGrid1.Invalidate(); }
        }
        #endregion

        // Initialization *****************************************************************
        #region Initialization
        public UCFrameList()
        {
            InitializeComponent();
        }
        #endregion

        // Resize *************************************************************************
        #region Resize
        private void UCFrameList_Resize(object sender, EventArgs e)
        {
            Point p = new Point(3, 22);
            Size s = new Size(Width - 6, Height - 25);
            ucDataGrid1.Location = p;
            ucDataGrid1.Size = s;
        }
        #endregion

        // Business Logic *****************************************************************
        #region Business Logic
        public void AddDataColumn(UCDataGrid.UCDataColumn c)
        {
            ucDataGrid1.AddDataColumn(c);
        }
        #endregion
    }
}
